<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图书类型</title>
    <script src="/js/jquery-3.5.1.js"></script>
    <style>

        html {
            filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
            -webkit-filter: grayscale(100%);
        }
        * {
            padding: 0;
            margin: 0;

            letter-spacing: .05em;
        }
        html {
            height: 100%;
        }

        body {
            height: 100%;
        }

        .d1{


            height: 100%;
            background-image: linear-gradient(to right,#fbc2eb,#a6c1ee);
        }
        .d2{

            background-color: #e39fe2;
            width: 250px;
            height: 500px;
            padding: 0 50px;
            position: relative;
            left: 50%;
            border-radius: 15px;
            top:50%;
            transform: translate(-50%,-50%);


        }

        .d2 input {
            display: block;
            width: 100%;
            margin-bottom: 20px;
            border: none;
            padding: 10px;
            border-bottom: 2px solid rgb(128,125,125);
            font-size: 15px;
            outline: none;
        }
        .header {
            font-size:  30px;
            font-weight: bold;
            text-align: center;
            line-height: 200px;
        }


    </style>
</head>
<body>


<div class="d1">

    <div class="d2">
        <div class="header">添加图书类型</div>

        <input type="text" id="typename"  placeholder=" 图书类型:"  onblur="validateIdCard()" /><span id="idCardTip"  style="color: red"></span><br>
        <input type="text" id="address"  placeholder="类型位置:"  onblur="validateBalance()" /><span id="balanceTip" style="color: red"> </span><br>
        <input type="button" value="提交" id="ti">
        <span id="backMsg"> </span>
    </div>
</div>

</body>
</html>
<script>

    $("#ti").click(function (){
        let typename=$("#typename");
        let address=$("#address");

        $.post("/add.admin",{"typename":typename,"address":address},function (text){
            $("#backMsg").html(text);
        })
    })
    // function validate(){
    //     document.myform.submit();
    // }
    // $(function (){
    //     $("#ti").click(function (){
    //         $.post
    //     })
    // })


</script>